sync: Added -g as a short option for --no-content
authorJoey Hess <joeyh@joeyh.name>
Wed, 17 May 2023 16:33:57 +0000 (12:33 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 17 May 2023 16:34:26 +0000 (12:34 -0400)
I anticipate that if sync is transitioned to syncing content by default,
people will want a short option. And in repositories where
annex.synccontent = true, they already would. And pull and push sync
content by default, so a short option is useful with them too.

Mnemonic: -g makes only git data be synced
Also, -a makes only annex data be synced.

Would have preferred -c, which would complement -C, but it
was already taken to set git configs.

Sponsored-by: Noam Kremen on Patreon
CHANGELOG
Command/Sync.hs
doc/git-annex-pull.mdwn
doc/git-annex-push.mdwn
doc/git-annex-sync.mdwn

index 317dc8ad2743a59f32af5c4287e9964317a1b89e..ec5bfa697e74494b58910b86d6acc737b45663f1 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -57,6 +57,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
     --content. With --no-pull, avoid downloading content, and with
     --no-push avoid uploading content. This was done before, but
     inconsistently.
+  * sync: Added -g as a short option for --no-content.
   * uninit: Avoid buffering the names of all annexed files in memory.
 
  -- Joey Hess <id@joeyh.name>  Sat, 08 Apr 2023 13:57:18 -0400
index c3e3473392bcc2cdc676326f88361e656a1463b0..ddd269fa54d9cf8fb5b30ba172ca0e25c54dbcfe 100644 (file)
@@ -181,6 +181,7 @@ optParser mode desc = SyncOptions
                )
        <*> switch
                ( long "no-content"
+               <> short 'g'
                <> help "do not transfer annexed file contents"
                )
        <*> many (strOption
index c481ae9bebbb10619b3ec0e4ca80803bb393ef7a..6095bf06c9de0a221d1091630af2fd7f73e9c92e 100644 (file)
@@ -67,9 +67,9 @@ See [[git-annex-preferred-content]](1).
   When this is combined with --no-content, only the git-annex branch
   will be pulled.
 
-* `--no-content`, `--content`
+* `--no-content, `-g`, `--content`
 
-  Use `--no-content` to avoid downloading (and dropping)
+  Use `--no-content` or `-g` to avoid downloading (and dropping)
   the content of annexed files.
 
   If you often use `--no-content`, you can set the `annex.synccontent`
index d0d9079b59e42b0d22a62676db3d222aa9c1337f..36bebaf519062c1773e00c4f074fddc8cbbbb12a 100644 (file)
@@ -76,10 +76,10 @@ See [[git-annex-preferred-content]](1).
   When this is combined with --no-content, only the git-annex branch
   will be pulled.
 
-* `--no-content`, `--content`
+* `--no-content`, `-g`, `--content`
 
-  Use `--no-content` to avoid uploading (and dropping) the content of annexed
-  files.
+  Use `--no-content` or `-g` to avoid uploading (and dropping) the content
+  of annexed files.
 
   If you often use `--no-content`, you can set the `annex.synccontent`
   configuration to false to prevent uploading content by default.
index cdc97b0206de55ef01808a4429b5d7faadc32657..96fcc17d54de45f65ddf573faa3588a64a00cbea 100644 (file)
@@ -19,11 +19,14 @@ content by default. This may change in a future version of git-annex.
 
 # OPTIONS
 
-* `--content`, `--no-content`
+* `--content`, `--no-content`, `-g`
 
   The --content option causes the content of annexed files
   to also be pulled and pushed.
 
+  The --no-content and -g options cause the content of annexed files to
+  not be pulled and pushed.
+
   The `annex.synccontent` configuration can be set to true to make
   `--content` be enabled by default.